package com.mall.search.feign;

import com.mall.search.model.SkuEs;
import com.mall.common.util.RespResult;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author Darren
 * @date 2022-08-22 15:26
 * Description：
 */
@FeignClient("mall-search")
@RequestMapping("/search/sku")
public interface SkuSearchFeign {

    @RequestMapping("/addIndex")
    @ApiOperation(value = "增加索引")
    RespResult addIndex(@RequestBody SkuEs skuEs);

    @RequestMapping("/delIndex/{id}")
    @ApiOperation(value = "删除索引")
    RespResult delIndex(@PathVariable("id") String id);

    @GetMapping
    @ApiOperation(value = "根据关键词搜索")
    @ApiImplicitParam(name = "keywords", value = "关键词")
    RespResult<Map<String, Object>> search(@RequestParam(required = false) Map<String, Object> searchMap);

}
